import 'package:flutter/material.dart';

class CartModalContent extends StatefulWidget {

  @override
  State<StatefulWidget> createState() {
    return _CartModalContentState();
  }
}

class _CartModalContentState extends State<CartModalContent> {

  int checkSpec = 0;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.all(11.0),
      child: Wrap(
        spacing: 11.0,
        children: <Widget>[
          Container(
            margin: EdgeInsets.only(top: 5.0),
            height: 32.0,
            width: 70.0,
            child: FlatButton(
                child: Text('10瓶装',style: TextStyle(fontSize: 12),),
                color: checkSpec == 0 ? Colors.orangeAccent :Colors.grey[200],
                textColor: checkSpec == 0 ? Colors.white : Colors.black87,
                onPressed: () => setState(() { checkSpec = 0; })
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 5.0),
            height: 32.0,
            width: 70.0,
            child: FlatButton(
                child: Text('10瓶装',style: TextStyle(fontSize: 12),),
                color: checkSpec == 1 ? Colors.orangeAccent :Colors.grey[200],
                textColor: checkSpec == 1 ? Colors.white : Colors.black87,
                onPressed: () => setState(() { checkSpec = 1; })
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 5.0),
            height: 32.0,
            width: 70.0,
            child: FlatButton(
                child: Text('10瓶装',style: TextStyle(fontSize: 12),),
                color: checkSpec == 2 ? Colors.orangeAccent :Colors.grey[200],
                textColor: checkSpec == 2 ? Colors.white : Colors.black87,
                onPressed: () => setState(() { checkSpec = 2; })
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 5.0),
            height: 32.0,
            width: 70.0,
            child: FlatButton(
                child: Text('10瓶装',style: TextStyle(fontSize: 12),),
                color: checkSpec == 3 ? Colors.orangeAccent :Colors.grey[200],
                textColor: checkSpec == 3 ? Colors.white : Colors.black87,
                onPressed: () => setState(() { checkSpec = 3; })
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 5.0),
            height: 32.0,
            width: 70.0,
            child: FlatButton(
                child: Text('10瓶装',style: TextStyle(fontSize: 12),),
                color: checkSpec == 4 ? Colors.orangeAccent :Colors.grey[200],
                textColor: checkSpec == 4 ? Colors.white : Colors.black87,
                onPressed: ()  => setState(() { checkSpec = 4; })
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 5.0),
            height: 32.0,
            width: 70.0,
            child: FlatButton(
                child: Text('10瓶装',style: TextStyle(fontSize: 12),),
                color: checkSpec == 5 ? Colors.orangeAccent :Colors.grey[200],
                textColor: checkSpec == 5 ? Colors.white : Colors.black87,
                disabledTextColor: Colors.black,
                onPressed: ()  => setState(() { checkSpec = 5; })
            ),
          ),
        ],
      ),
    );
  }
}